package com.oopnet.template.test.patterns;

import java.util.Observable;
import java.util.Observer;

/**
 * @author mercy_yang
 *
 */
public class Student extends Observable{
	
	private String name;
	
	public Student(String name,Observer o) {
		this.name = name;
		addObserver(o);
	}
	
	public Student(String name) {
		this.name = name;
	}
	
	public void saySomeThing(String s){
		System.out.println("Say to some one !");
		
		
		setChanged();
		
		notifyObservers(s);
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "[" + name + "] ";
	}
	
	
}
